package com.weipai.education.dao.impl;

import com.weipai.education.dao.UserCategoryDao;
import com.weipai.education.mapper.UserCategoryMapper;
import com.weipai.education.model.UserCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/10 14:58
 */
@Repository
public class UserCategoryDaoImpl implements UserCategoryDao{

    @Autowired
    private UserCategoryMapper userCategoryMapper;

    @Override
    public int update(UserCategory userCategory) {
        return userCategoryMapper.updateByPrimaryKeySelective(userCategory);
    }

    @Override
    public int insert(UserCategory userCategory) {
        return userCategoryMapper.insert(userCategory);
    }

    @Override
    public UserCategory selectByPrimaryKey(String id) {
        return userCategoryMapper.selectByPrimaryKey(Integer.parseInt(id));
    }

    @Override
    public List<Map<String, Object>> list(Integer start, Integer size, String dispark) {
        return userCategoryMapper.list(start, size, dispark);
    }

    @Override
    public Integer listAmount(String dispark) {
        return userCategoryMapper.listAmount(dispark);
    }

    @Override
    public int batchDeleteById(String[] id) {
        return userCategoryMapper.batchDeleteById(id);
    }

    @Override
    public List<UserCategory> getAreaRateUserCate() {
        return userCategoryMapper.getAreaRateUserCate();
    }

    @Override
    public UserCategory getUserCateInfo() {
        return userCategoryMapper.getUserCateInfo();
    }


}
